#pragma once

#ifndef _CORE_LOGGER_H_
#define _CORE_LOGGER_H_

#include "Poco/Logger.h"
#include "Poco/AutoPtr.h"
#include "Poco/Formatter.h"


namespace ExamSystem
{
    using Poco::Logger;
    using Poco::AutoPtr;
    using Poco::Channel;
    using Poco::Formatter;

    class CExamLogger
    {
    protected:
        CExamLogger(void);
        
    public:
        static Logger &SystemLogger(void);
        static Logger &CreateLogger(const char *fileName, Poco::Message::Priority prio = 
#ifdef _DEBUG
            Poco::Message::PRIO_TRACE
#else
            Poco::Message::PRIO_INFORMATION
#endif
            );

    protected:
        static Logger *ms_systemLogger;

        static AutoPtr<Channel> ms_splitterChannel;
        static AutoPtr<Channel> ms_consoleChannel;
        static AutoPtr<Channel> ms_fileChannel;
        static AutoPtr<Formatter> ms_formatter;
        static AutoPtr<Channel> ms_formattingChannel;
    };

#define systemLogger CExamLogger::SystemLogger()
}

#endif